package com.study.controller.user;

import com.study.result.Result;
import com.study.service.InformationService;
import com.study.vo.InformationVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user/information")
@Slf4j
@Api(tags = "资讯相关接口")
public class InformationController {

    @Autowired
    InformationService informationService;

    /**
     * 获取资讯列表
     * @return
     */
    @GetMapping("/list")
    @ApiOperation("获取资讯列表")
    public Result<InformationVO> getInformationList() {
        InformationVO informationList = informationService.getInformationList();
        return Result.success(informationList);
    }
}
